//
//  main.m
//  08-homeWork
//
//  Created by 402030900@qq.com on 16/7/13.
//  Copyright © 2016年 402030900@qq.com. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Boy.h"
#import "Girl.h"
#import "Teacher.h"
#import "NSMutableArray+Covert.h"
int main(int argc, const char * argv[]) {
//   1. iOS9新特性三块的深入理解, 创建几个类, 熟悉写法(提交练习成果)
//   2. iOS 类扩展方式的复习 1> 给NSMutableArray添加convert方法，实现数组倒序。
//   3. 预习UI内容
    
#if 1
    // 1.nonability
    // nonull
    // nullable
    // null_resetable
    
    // 1> nonull
    Boy * boy = [[Boy alloc] init];
    boy.name = @"Fly";
    [boy setName:@"Fly"];
    [boy name];
    // 2> nullable
    [boy setGFSex:nil];
    // 3>nonresettable
    [boy setGFLike:nil];

#endif
#if 1
    // 泛型数组
    NSMutableArray<NSString *> * array = [NSMutableArray arrayWithObjects:@"123",@10, nil];
//    [array addObject:@10];
    [array.firstObject length];
    // 泛型字典
    NSMutableDictionary<NSString *,NSString *> * dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"Fly",@"Name", nil];
//    [dic setObject:@10 forKey:@"age"];
    //自定义泛型
    Girl<Boy*>* girl = [[Girl alloc]init];
    [girl addBF:boy];
    // 协变性 与 逆变性
    Girl * girl0 = nil;
    Girl<NSArray *> * girl1 = nil;
    Girl<NSMutableArray *> *girl2 = nil;
    girl0 = girl1;
    girl0 = girl2;
    girl1 = girl0;
    girl2 = girl0;
    girl1 = girl2;// 协变性:子类给父类赋值,自动强转
    girl2 = girl1;// 逆变性:父类给子类赋值,自动强转
    // __kindOf
    Teacher * kindOfTeacher = [[Teacher alloc]init];
    NSMutableArray * arr = [kindOfTeacher returnArray];
#endif
#if 1
    NSMutableArray * ConvertArray = [NSMutableArray arrayWithObjects:@1,@2,@3,@4, nil];
    NSMutableArray * convert = [ConvertArray Convert:ConvertArray];
    NSLog(@"%@",convert);
#endif
    
    
    
    
    
    return 0;
}
